import fetch from '@/utils/fetch'

export function loginByEmail (username, password) {
  const data = {
    username,
    password
  }
  return fetch({
    url: '/system/auth/login',
    method: 'post',
    data
  })
}

export function logout (token) {
  return fetch({
    url: '/api/auth/jwt/invalid',
    method: 'post',
    data: token
  })
}

export function getInfo (token) {
  return fetch({
    url: '/system/auth/user/Info',
    method: 'post',
    data: token
  })
}

export function getMenus (token) {
  return fetch({
    url: '/system/auth/menus',
    method: 'post',
    data: token
  })
}

export function getAllMenus () {
  return fetch({
    url: '/system/auth/all/menus',
    method: 'get'
  })
}
